<!DOCTYPE html>
<html lang="en" xmlns:th="https://www.thymeleaf.org" xmlns:background="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8" >
    <div th:replace="common/common::html"></div>
    <title>Title</title>
    <script th:inline="javascript">
        var _gridWidth;
        var _gridHeight;

        //页面自适应
        function resizePageSize() {
            _gridWidth = $(document).width() - 12;/*  -189 是去掉左侧 菜单的宽度，   -12 是防止浏览器缩小页面 出现滚动条 恢复页面时  折行的问题 */
            _gridHeight = $(document).height() - 32 - 60; /* -32 顶部主菜单高度，   -90 查询条件高度*/
        }

        var allocateSetting = {
            check: {
                enable: true
            },
            data: {
                simpleData: {
                    enable: true
                }
            }
        };

        $(function () {
            resizePageSize();
            $("#addDepartment").click(function (event) {
                event.stopPropagation();
                var depUuid=$("#depUuid").val();
                var belongCenter=$("#belongCenter").val();
                var branchName=$("#branchName").val();
                var organUuid=$("#organUuid").val();
                $.ajax({
                        type: 'post',
                        async: false,
                        dataType : 'json',
                        url: /*[[@{addDepartment}]]*/'',
                        data: [
                            {name:"depUuid",value:depUuid},
                            {name:"belongCenter",value:belongCenter},
                            {name:"branchName",value:branchName},
                            {name:"organUuid",value:organUuid}
                        ],
                        success: function (data) {
                            message("新增部门成功");
                        },
                        error: function(msg){
                            message(/*[[#{common.error}]]*/'');
                        }
                    }
                );
            });

            $("#delDepartment").click(function (event) {
                event.stopPropagation();
                var depUuid=$("#depUuid").val();
                $.ajax({
                        type: 'post',
                        async: false,
                        dataType : 'json',
                        url: /*[[@{delDepartment}]]*/'',
                        data: [{name:"depUuid",value:depUuid},],
                        success: function (data) {
                            message("删除部门成功");
                        },
                        error: function(msg){
                            message(/*[[#{common.error}]]*/'');
                        }
                    }
                );
            });
        })//ready
    </script>
</head>
<body>
<!解绑，绑定，删除，新增，修改>
<div style="flex-basis: 120px;display: flex;flex-direction: row;margin-left: 400px;">
    <button th:text="解绑" style="height:30px;width:95px;"></button>
    <button th:text="绑定" style="height:30px;width:95px;margin-left: 8px"></button>
    <button id="delDepartment" th:text="删除" style="height:30px;width:95px;margin-left: 8px"></button>
    <button id="addDepartment" th:text="新增" style="height:30px;width:95px;margin-left: 8px"></button>
    <button th:text="修改" style="height:30px;width:95px;margin-left: 8px"></button>
</div>
<!部门属性>
<div style=":height:200px;width:500px;display: flex;flex-direction: column;margin-top: 10px;margin-left: 400px">
    <div style="margin-top: 25px;margin-left: 10px;display: flex;flex-direction: row;">
        <div>
            <span>部门编码</span>
            <input id="depUuid" style="height: 30px;width: 175px">
        </div>
        <div style="margin-left: 10px">
            <span>归属编码</span>
            <input id="belongCenter" style="height: 30px;width: 175px">
        </div>
    </div>
    <div style="margin-top: 25px;margin-left: 10px;display: flex;flex-direction: row;">
        <div>
            <span>部门名称</span>
            <input  id="branchName" style="height: 30px;width: 175px">
        </div>
    </div>
    <div style="margin-top: 25px;margin-left: 10px;display: flex;flex-direction: row;">
        <div>
            <span>部门类型</span>
            <input id="organUuid"style="height: 30px;width: 175px">
        </div>
    </div>
</div>
<!岗位列表，部门调整>
<div style="flex-basis: 120px;display: flex;flex-direction: row;margin-left: 400px;margin-top: 10px">
    <button th:text="岗位列表" style="height:30px;width:100px;"></button>
    <button th:text="部门调整" style="height:30px;width:100px;margin-left: 10px"></button>
</div>
<!表格>
<div style="height:200px;width:500px;display: flex;flex-direction: column;margin-top: 10px;margin-left: 400px">
    <table border="1">
        <tr>
            <th>岗位编码</th>
            <th>岗位名称</th>
            <th>角色名称</th>
            <th>  操作  </th>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
    </table>
</div>
</body>
</html>